package main

import (
	"helloBeego/filters"
	_ "helloBeego/routers"

	"github.com/beego/beego/v2/core/logs"
	beego "github.com/beego/beego/v2/server/web"
	// beecontext "github.com/beego/beego/v2/server/web/context"
)

func main() {

	logs.Info("注入 TokenFilter")
	// 对全路径，执行 Controller 前，进行过滤
	beego.InsertFilter("*", beego.BeforeExec, filters.TokenFilter)

	s, err := beego.AppConfig.String("AppName")
	if err != nil {
		s = "web"
	}
	logs.Info("================", s, "启动成功 ==============")

	beego.Run()
}
